import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/adminLogin',
      name: 'AdminLogin',
      component: () => import('../pages/admin/AdminLogin')
    },
    {
      path: '/teacherLogin',
      name: 'TeacherLogin',
      component: () => import('../pages/teacher/TeacherLogin')
    },
    {
      path: '/studentLogin',
      name: 'StudentLogin',
      component: () => import('../pages/student/StudentLogin')
    },
    {
      path: '/bank',
      name: 'Bank',
      component: () => import('../pages/teacher/questionBank/Bank'),
      children: [
        {
          path: 'personalBank',
          name: 'PersonalBank',
          component: () => import('../pages/teacher/questionBank/PersonalBank')
        },
        {
          path: 'personalQuestion',
          name: 'PersonalQuestion',
          component: () => import('../pages/teacher/questionBank/PersonalQuestion')
        },
        {
          path: 'questions',
          name: 'Question',
          component: () => import('../pages/teacher/questionBank/Questions')
        }
      ]
    },
    {
      path: '/exam',
      name: 'Exam',
      component: () => import('../pages/teacher/exam/Exam'),
      children: [
        {
          path: 'examManage',
          name: 'ExamManage',
          component: () => import('../pages/teacher/exam/ExamManage')
        },
        {
          path: 'examDetail',
          name: 'ExamDetail',
          component: () => import('../pages/teacher/exam/ExamDetail')
        },
        {
          path: 'paper',
          name: 'Paper',
          component: () => import('../pages/teacher/exam/Paper')
        },
        {
          path: 'questionAdd',
          name: 'QuestionAdd',
          component: () => import('../pages/teacher/exam/QuestionAdd')
        },
        {
          path: 'questionForPaper',
          name: 'QuestionForPaper',
          component: () => import('../pages/teacher/exam/QuestionForPaper')
        }
      ]
    },
    {
      path: '/mark',
      name: 'Mark',
      component: () => import('../pages/teacher/mark/Mark'),
      children: [
        {
          path: 'examForPaper',
          name: 'ExamForPaper',
          component: () => import('../pages/teacher/mark/ExamForPaper')
        },
        {
          path: 'examMark',
          name: 'ExamMark',
          component: () => import('../pages/teacher/mark/ExamMark')
        },
        {
          path: 'answerPaperDetail',
          name: 'AnswerPaperDetail',
          component: () => import('../pages/teacher/mark/AnswerPaperDetail')
        }
      ]
    },
    {
      path: '/analysis',
      name: 'Analysis',
      component: () => import('../pages/teacher/analysis/Analysis'),
      children: [
        {
          path: 'examForAnalysis',
          name: 'ExamForAnalysis',
          component: () => import('../pages/teacher/analysis/ExamForAnalysis')
        },
        {
          path: 'examAnalysis',
          name: 'ExamAnalysis',
          component: () => import('../pages/teacher/analysis/ExamAnalysis')
        }
      ]
    },
    {
      path: '/admin',
      name: 'Admin',
      component: () => import('../pages/admin/Admin'),
      children: [
        {
          path: 'questionBankManage',
          name: 'QuestionBankManage',
          component: () => import('../pages/admin/questionBank/QuestionBankManage')
        },
        {
          path: 'questionManage',
          name: 'QuestionManage',
          component: () => import('../pages/admin/questionBank/QuestionManage')
        },
        {
          path: 'userManage',
          name: 'UserManage',
          component: () => import('../pages/admin/user/UserManage')
        }
      ]
    },
    {
      path: '/student',
      name: 'Student',
      component: () => import('../pages/student/Student'),
      children: [
        {
          path: 'exam',
          name: 'Exam',
          component: () => import('../pages/student/exam/MyExams')
        },
        {
          path: 'examInfo',
          name: 'ExamInfo',
          component: () => import('../pages/student/exam/ExamInfo')
        },
        {
          path: 'paper',
          name: 'Paper',
          component: () => import('../pages/student/exam/Paper')
        },
        {
          path: 'finishExam',
          name: 'finishExam',
          component: () => import('../pages/student/exam/FinishExam')
        },
        {
          path: 'bank',
          name: 'Bank',
          component: () => import('../pages/student/bank/Bank')
        },
        {
          path: 'question',
          name: 'Question',
          component: () => import('../pages/student/bank/Question')
        },
        {
          path: 'questionDetail',
          name: 'QuestionDetail',
          component: () => import('../pages/student/bank/QuestionDetail')
        },
        {
          path: 'scoreList',
          name: 'ScoreList',
          component: () => import('../pages/student/score/scoreList')
        },
        {
          path: 'score',
          name: 'Score',
          component: () => import('../pages/student/score/score')
        },
        {
          path: 'analysis',
          name: 'analysis',
          component: () => import('../pages/student/score/analysis')
        }
      ]
    },
    {
      path: '*',
      name: '404',
      component: () => import('../pages/NotFound')
    }
  ]
})
